package com.example.xxljobdemo.handler;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

@JobHandler("testHandler")
@Component
public class TestHandler extends IJobHandler {
    @Override
    public ReturnT<String> execute(String s) throws Exception {
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println(sdf.format(new Date()));
        System.out.println("参数:" + s);
        return ReturnT.SUCCESS;
    }
}
